home *** CD-ROM | disk | FTP | other *** search
- #import <sgtty.h>
- #define NOPARITY (0)
- #define ILLEGAL_PARITY (99)
- #import <objc/Object.h>
-
- /* the class Tty is for handling devices that are driven
- by the general terminal interface -- see tty(4) */
-
- @interface Tty:Object
- {
- int fd; // file descriptor for reads and writes
- int par; // parity (EVENP, ODDP, or NOPARITY)
- struct sgttyb origState; // for the reset method
- struct sgttyb currentState; // for calls to ioctl
- }
-
- + newDevice:(char *)devname access:(int)flags;
- + newReadDevice:(char *)devname;
- + newWriteDevice:(char *)devname;
- + newReadWriteDevice:(char *)devname;
- + newExistingfd:(int)thisfd; // for already existing file descriptor (eg. 0=stdin 1=stdout 2=stderr)
- - reset;
- - setEcho;
- - unSetEcho;
- - setRaw;
- - unSetRaw;
- - setCbreak;
- - unSetCbreak;
- - setCrmod;
- - unSetCrmod;
- - activateState; // this is meant to be a private method
- - setSpeed:(int)bps;
- - setParity:(int)parity; //parity is either EVENP, ODDP, or NOPARITY
- - (int) getSpeed;
- - (int) getParity;
- - (int) getfd;
- - (int) queuedChars; //returns number of characters ready to be read
- - (int) readInto:(char *)buf; //returns number of characters read into buf
- - (int) writeOut:(char *)buf;
-
- @end
-